{layout name="layout/header" /}
<link href="root/css/plugins/iCheck/custom.css" rel="stylesheet">
<link href="root/js/plugins/fancybox/jquery.fancybox.css" rel="stylesheet">

<div class="wrapper wrapper-content animated fadeInRight" id="app">

    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>广告设置</h5>
                    <div class="ibox-tools">
                        <a type="button" class="btn btn-primary btn-sm" href="{:url('index')}">返回列表页</a>
                    </div>
                </div>
                <div class="ibox-content">
                    <form method="post" class="form-horizontal" id="form" action="{:url('index')}">
                        <!--图片上传-->
                        {volist name="$data" id="vo"}
                        {if condition="$vo.is_multi"}
                            <div class="form-group">
                                <label class="col-sm-1 control-label">{$vo.title}</label>
                                <div class="col-sm-10">
                                    <button class="btn btn-success product_upload_img" type="button">
                                        <i class="fa fa-upload"></i>&nbsp;&nbsp;<span class="bold">上传</span>
                                    </button>
                                    <input class="imgs" type="file" style="display: none;"  data-field="{$vo.name}"/>
                                    <span class="help-block m-b-none">{$vo.remark}</span>
                                </div>
                                <div class="col-sm-11 col-sm-offset-1 ">
                                    <div class="row" id="{$vo.name}">
                                        {notempty name="$vo.value"}
                                        {volist name="$vo.value" id="vc"}
                                        <div class="img_box col-xs-12 col-md-3" >
                                            <a class="fancybox" href="{$vc}">
                                                <img alt="image" src="{$vc}"/>
                                                <input type="hidden" name="{$vo.name}[]" value="{$vc}">
                                            </a>
                                            <a class="glyphicon glyphicon-trash" onclick="del_img(this)" ></a>
                                        </div>
                                        {/volist}
                                        {/notempty}
                                    </div>
                                </div>
                            </div>
                        {else/}
                            <div class="form-group">
                                <label class="col-sm-1 control-label">{$vo.title}</label>
                                <div class="col-sm-10">
                                    <button class="btn btn-success product_upload_img" type="button">
                                        <i class="fa fa-upload"></i>&nbsp;&nbsp;<span class="bold">上传</span>
                                    </button>
                                    <input class="img" type="file" style="display: none;"  data-field="{$vo.name}"/>
                                    <span class="help-block m-b-none">{$vo.remark}</span>
                                </div>
                                <div class="col-sm-11 col-sm-offset-1 ">
                                    <div class="row" id="{$vo.name}">
                                        {notempty name="$vo.value"}
                                        <div class="img_box col-xs-12 col-md-3" >
                                            <a class="fancybox" href="{$vo.value}">
                                                <img alt="image" src="{$vo.value}"/>
                                                <input type="hidden" name="{$vo.name}" value="{$vo.value}">

                                            </a>
                                            <a class="glyphicon glyphicon-trash" onclick="del_img(this)" ></a>
                                        </div>
                                        {/notempty}
                                    </div>
                                </div>
                            </div>
                        {/if}

                        {/volist}
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-2">
                                <button class="btn btn-primary" type="submit" >保存内容</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>

<!-- iCheck -->
<script src="root/js/plugins/iCheck/icheck.min.js"></script>
<!--layer-->
<script src="root/js/plugins/layer/layer.min.js"></script>

<script src="root/js/plugins/validate/jquery.validate.min.js"></script>
<script src="root/js/plugins/validate/messages_zh.min.js"></script>

<script src="root/js/plugins/fancybox/jquery.fancybox.js"></script>
<script>
    $(function () {
        $('.fancybox').fancybox({
            openEffect: 'none',
            closeEffect: 'none'
        });
    })
</script>
